package au.com.handsunited.model;


import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Indexed;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import au.com.handsunited.jodawrapper.JodaDateTimeWrapper;


/**
 * @author arunda
 *
 */
@Indexed
public abstract class MotherOfAllEntities {

	@DocumentId
	private Long id;

	protected JodaDateTimeWrapper dateCreated;
	protected JodaDateTimeWrapper lastModified;

	protected Boolean active;


	private static Logger logger = LoggerFactory.getLogger(MotherOfAllEntities.class);

	public MotherOfAllEntities() {
		dateCreated = new JodaDateTimeWrapper();
		active = true;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public JodaDateTimeWrapper getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(JodaDateTimeWrapper dateCreated) {
		this.dateCreated = dateCreated;
	}

	public JodaDateTimeWrapper getLastModified() {
		return lastModified;
	}

	public void setLastModified(JodaDateTimeWrapper lastModified) {
		this.lastModified = lastModified;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = Boolean.valueOf(active);
	}

	public void disable() {
		active = false;
	}

	public void enable() {
		active = true;
	}

	public void delete() {
		disable();
	}

}
